#ifndef ACTION_ACTION_H_20221006
#define ACTION_ACTION_H_20221006

#include "event_id.h"
#include <string>

namespace action {

class Action {
 public:
  enum class Status {
    kIdle,
    kRunning,
    kFinished,
  };
  virtual std::string type() const = 0;
  virtual void start();
  virtual void stop();

  Status status() const { return status_; }

 public:
  virtual void onEvent(EventId event_id, void *event_data) { }

 protected:
  void finish();

 private:
  Status status_ = Status::kIdle;
};

}

#endif //ACTION_ACTION_H_20221006
